package com.example.aiquestions.model.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;

@Data

@JsonIgnoreProperties(ignoreUnknown = true)
public class QuestionResponse {
    private Integer code;
    private String message;
    private QuestionData data;

    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class QuestionData {
        private String questionType;  // SINGLE_CHOICE, MULTIPLE_CHOICE, SHORT_ANSWER, TRUE_FALSE, FILL_BLANK, READING
        private String stem;
        private List<Option> options;
        private String answer;        // 单选题、判断题答案
        private List<String> answers; // 多选题答案
        private List<String> blanks;  // 填空题答案
        private String passage;       // 阅读理解文章内容
        private List<SubQuestion> subQuestions; // 阅读理解子题目
        private String analysis;
        private Integer difficulty;
        private List<String> tags;
        private List<String> knowledgePoints;
        private List<KeyPoint> keyPoints;  // 简答题答案要点
        private Integer score;        // 填空题每空分值
        private Integer totalScore;   // 简答题、填空题、阅读理解总分

        public QuestionData() {
        }

        public QuestionData(String questionType, String stem, List<Option> options, String answer, List<String> answers, List<String> blanks, String passage, List<SubQuestion> subQuestions, String analysis, Integer difficulty, List<String> tags, List<String> knowledgePoints, List<KeyPoint> keyPoints, Integer score, Integer totalScore) {
            this.questionType = questionType;
            this.stem = stem;
            this.options = options;
            this.answer = answer;
            this.answers = answers;
            this.blanks = blanks;
            this.passage = passage;
            this.subQuestions = subQuestions;
            this.analysis = analysis;
            this.difficulty = difficulty;
            this.tags = tags;
            this.knowledgePoints = knowledgePoints;
            this.keyPoints = keyPoints;
            this.score = score;
            this.totalScore = totalScore;
        }

        public String getQuestionType() {
            return questionType;
        }

        public void setQuestionType(String questionType) {
            this.questionType = questionType;
        }

        public String getStem() {
            return stem;
        }

        public void setStem(String stem) {
            this.stem = stem;
        }

        public List<Option> getOptions() {
            return options;
        }

        public void setOptions(List<Option> options) {
            this.options = options;
        }

        public String getAnswer() {
            return answer;
        }

        public void setAnswer(String answer) {
            this.answer = answer;
        }

        public List<String> getAnswers() {
            return answers;
        }

        public void setAnswers(List<String> answers) {
            this.answers = answers;
        }

        public List<String> getBlanks() {
            return blanks;
        }

        public void setBlanks(List<String> blanks) {
            this.blanks = blanks;
        }

        public String getPassage() {
            return passage;
        }

        public void setPassage(String passage) {
            this.passage = passage;
        }

        public List<SubQuestion> getSubQuestions() {
            return subQuestions;
        }

        public void setSubQuestions(List<SubQuestion> subQuestions) {
            this.subQuestions = subQuestions;
        }

        public String getAnalysis() {
            return analysis;
        }

        public void setAnalysis(String analysis) {
            this.analysis = analysis;
        }

        public Integer getDifficulty() {
            return difficulty;
        }

        public void setDifficulty(Integer difficulty) {
            this.difficulty = difficulty;
        }

        public List<String> getTags() {
            return tags;
        }

        public void setTags(List<String> tags) {
            this.tags = tags;
        }

        public List<String> getKnowledgePoints() {
            return knowledgePoints;
        }

        public void setKnowledgePoints(List<String> knowledgePoints) {
            this.knowledgePoints = knowledgePoints;
        }

        public List<KeyPoint> getKeyPoints() {
            return keyPoints;
        }

        public void setKeyPoints(List<KeyPoint> keyPoints) {
            this.keyPoints = keyPoints;
        }

        public Integer getScore() {
            return score;
        }

        public void setScore(Integer score) {
            this.score = score;
        }

        public Integer getTotalScore() {
            return totalScore;
        }

        public void setTotalScore(Integer totalScore) {
            this.totalScore = totalScore;
        }

        @Data
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class SubQuestion {
            private Long id;
            private String stem;
            private List<Option> options;
            private String answer;
            private String analysis;
            private Integer score;

            public SubQuestion() {
            }

            public SubQuestion(Long id,String stem, List<Option> options, String answer, String analysis, Integer score) {
                this.id = id;
                this.stem = stem;
                this.options = options;
                this.answer = answer;
                this.analysis = analysis;
                this.score = score;
            }

            public String getStem() {
                return stem;
            }

            public void setStem(String stem) {
                this.stem = stem;
            }

            public List<Option> getOptions() {
                return options;
            }

            public void setOptions(List<Option> options) {
                this.options = options;
            }

            public String getAnswer() {
                return answer;
            }

            public void setAnswer(String answer) {
                this.answer = answer;
            }

            public String getAnalysis() {
                return analysis;
            }

            public void setAnalysis(String analysis) {
                this.analysis = analysis;
            }

            public Integer getScore() {
                return score;
            }

            public void setScore(Integer score) {
                this.score = score;
            }

            public Long getId() {
                return id;
            }

            public void setId(Long id) {
                this.id = id;
            }
        }

        @Data
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class Option {
            private String optionId;
            private String content;

            public Option() {
            }

            public Option(String optionId, String content) {
                this.optionId = optionId;
                this.content = content;
            }

            public String getOptionId() {
                return optionId;
            }

            public void setOptionId(String optionId) {
                this.optionId = optionId;
            }

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }
        }

        @Data
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class KeyPoint {
            private String point;
            private Integer score;

            public KeyPoint() {
            }

            public KeyPoint(String point, Integer score) {
                this.point = point;
                this.score = score;
            }

            public String getPoint() {
                return point;
            }

            public void setPoint(String point) {
                this.point = point;
            }

            public Integer getScore() {
                return score;
            }

            public void setScore(Integer score) {
                this.score = score;
            }
        }
    }
} 